package com.cloudfactory.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.cloudfactory.service.SettledEnterpriseService;
import com.cloudfactory.service.ThemeActivityService;

@Controller
@RequestMapping(value = "/")
public class IndexController {

	@Autowired
	private ThemeActivityService themeActivityService;

	@Autowired
	private SettledEnterpriseService settledEnterpriseService;

	@RequestMapping(value = "/index")
	public String index(Model model) {
		model.addAttribute("themeActivities", themeActivityService.selectAll());
		model.addAttribute("settledEnterprises", settledEnterpriseService.selectAll());
		return "/index.jsp";
	}

}
